global demo,current_pm,dopm, prof_rolls, menumouse,sub_open,winhelp
on see_sprite plist, bool
repeat with e in plist
set the visible of sprite e to bool
end repeat
updatestage
end
on nn memname
put the membernum of member memname
end
on menumouse_check
if menumouse then
if the timer < 60 then
set menumouse = 0
abort
end if
end if
end
on set_cursors clist
global oldclist
if not voidp(oldclist) then
repeat with x in oldclist
set the cursor of sprite x to 0
end repeat
end if
repeat with x in clist
set the cursor of sprite x = [the membernum of member "hand",the membernum of member "hand mask"]
end repeat
set oldclist = clist
cursor 0
end
on pm_prep pm
cursor 4
set current_pm = pm
set test = demo_check(current_pm)
if not test then
set dopm = TRUE
cursor 0
end if
end
on idle
if not sub_open then
pmidle
eraidle
if winhelp then
global helpapp
openxlib "dllglue.dll"
set findObj = DLLGLUE( mNew, "USER.EXE", "FindWindow", "W", "SS" )
set toTop = DLLGLUE( mNew, "USER.EXE", "BringWindowToTop","I","W")
set sw to dllglue(mnew, "USER.EXE", "ShowWindow", "V", "WI")
global win31
if win31 then
set theWindow to findObj( mCall, 0, "pmhelp31" )
else
set theWindow to findObj( mCall, 0, "pmhelp" )
end if
if theWindow > 0 then
toTop( mCall, theWindow )
sw(mcall, theWindow, 9)
else
open helpapp with "winhelp"
end if
toTop(mdispose)
findObj(mdispose)
sw(mdispose)
set winhelp to false
end if
end if
end
on convert32 theList
set red to (getAt(theList, 1) * 255 * 65536) / 100.00
set green to (getAt(theList, 2) * 255 * 256) / 100.00
set blue to (getAt(theList, 3) * 255 * 1) / 100.00
return red + green + blue
end
on convert16 theList
set normedList = theList / 8
set red to integer(getAt(normedList, 1)) * 1024
set green to integer(getAt(normedList, 2)) * 32
set blue to integer(getAt(normedList, 1))
return red + green + blue
end
on eraidle
global doera
if doera <> 0 then
set tmp = doera
set doera = 0
-- put tmp
goera(tmp)
end if
end
on fullPathFor destFileName -- figures out correct pathname for (director) files containing 'prof', 'arch' or 'era_' for PM cd structure (kf 11/20/96)
set pathHead = the moviepath
if the machinetype = 256 then set pd = "\"
else set pd = ":"
case true of
((the movie contains "arch") or (the movie contains "prof")) and (destfilename contains "era_"):
if destfilename <> "era_top.dir" then
set tail = "eras" & pd & char 5 to 6 of destFileName & pd & destfilename
else set tail = "eras" & pd & destfilename
set fullPathName = pathhead & tail
((the movie contains "era_") and ((destFileName contains "arch") or (destFileName contains "prof"))):
delete char offset("pb", the moviepath)+3 to length(the moviepath) of pathhead
set fullPathName = pathhead & destFileName
-- ((the movie contains "era_") and
(destFileName contains "era_"):
delete char offset("pb", the moviepath)+3 to length(the moviepath) of pathhead
if destfilename contains "era_top.dir" then
set tail = "eras" & pd & destfilename
else
set tail = "eras" & pd & char 5 to 6 of destFileName & pd & destfilename
end if
set fullPathName = pathhead & tail
otherwise:
delete char offset("pb", the moviepath)+3 to length(the moviepath) of pathhead
set fullPathName = pathhead & destFileName
end case
return fullPathName
end
on pmidle
if dopm = TRUE then
if (the moviename <> "profile.dir") then
if the colordepth > 8 then puppettransition 51,02,08
if the moviename contains "era_" then
go to marker("fadeout") + 1
else
go to "fadeout"
end if
set the castnum of sprite 1 to cast "load_pro"
updatestage
-- sound playfile 1, "00prf.aif"
go to movie fullpathfor("profile.dir") -- prs kf 11/20/96
abort
end if
global current_pm
if voidp(current_pm) then dopm(0)
else dopm(current_pm)
end if
end
on era_prep pm
global doera
if pm <> 0 then
set doera = pm
end if
end
on goera the_pm
global gnextmoviefilename
unload
sound stop 1
if the colordepth > 8 then puppettransition 51,02,08
go to "fadeout"
case demo of
0 :
case the_pm of
1,2,3,4,5,6 :
set gnextmoviefilename = "era_vi.dir"
if the movie <> gnextmoviefilename then go to movie gnextmoviefilename
7 :
set gnextmoviefilename = "era_la.dir"
if the movie <> gnextmoviefilename then go to movie gnextmoviefilename
8,9,11 :
set gnextmoviefilename = "era_gp.dir"
if the movie <> gnextmoviefilename then go to movie gnextmoviefilename
10, 12:
set gnextmoviefilename = "era_ky.dir"
if the movie <> gnextmoviefilename then go to movie gnextmoviefilename
13,14 :
set gnextmoviefilename = "era_td.dir"
if the moviename <> gnextmoviefilename then
-- sound playfile 1, "diana.aif"
go to movie gnextmoviefilename
end if
15, 16, 17 :
set gnextmoviefilename = "era_ty.dir"
if the movie <> gnextmoviefilename then go to movie gnextmoviefilename
18,19, 20 :
set gnextmoviefilename = "era_ad.dir"
if the movie <> gnextmoviefilename then go to movie gnextmoviefilename
end case
1 :
if the movie = "archive.dir" then
archive_check
set gnextmoviefilename = "era_top.dir"
else
case the_pm of
13,14 : set gnextmoviefilename = "era_td.dir"
-- 10 : set gnextmoviefilename = "era_ky.dir"
otherwise
set gnextmoviefilename = "era_top.dir"
end case
end if
if the moviename <> gnextmoviefilename then
if gnextmoviefilename <> "era_td.dir" then
-- sound playfile 1, "old_girl.aif"
else
-- sound playfile 1, "diana.aif"
end if
go to movie gnextmoviefilename
end if
end case
abort
end
on purgemem
unload
end
on soundcheck pm
global done_sound
if not done_sound then
sound stop 1
set tfl to the framelabel
if length(string(tfl)) > 0 then
if not(tfl contains "w") then
case (pm) of
"1": sound playFile 1, "01prf.aif"
"7": sound playFile 1, "07prf.aif"
"10": sound playFile 1, "10prf.aif"
"13": sound playFile 1, "13prf.aif"
"14": sound playFile 1, "14prf.aif"
"15": sound playFile 1, "15prf.aif"
"18": sound playFile 1, "18prf.aif"
end case
end if
end if
end if
set done_sound = 0
end
on erademopop
opendemopop(#eras)
end
on democheck_era gDestMovie
global demo
if demo then
case gDestMovie of
"era_ty.dir" :
opendemopop #eras
return true
"era_gp.dir" :
opendemopop #eras
return true
otherwise
return false
end case
abort
end if
end
on demo_check the_pm
if demo then
case the_pm of
"0","1", "2","4","5","6","9","10","11","13","14","15","17" : set doit to true
end case
if voidp(doit) then
cursor 4
set dopm = 0
opendemopop(#profile)
return true
abort
end if
end if
end
on opendemopop state
cursor 4
set the visible of window "demopop.dir" = false
set the windowType of window "demopop.dir" = 2
set the modal of window "demopop.dir" = true
case state of
#profile : tell window "demopop.dir" to go to frame 1
#eras : tell window "demopop.dir" to go to frame 2
#archive : tell window "demopop.dir" to go to frame 3
#preview : tell window "demopop.dir" to go to frame 4
#previewtop : tell window "demopop.dir" to go to frame 5
#quit : tell window "demopop.dir" to go to frame 6
end case
set stop = the rect of the stage
set drect = the rect of window "demopop.dir"
set the rect of window "demopop.dir" = rect(the left of stop + 24,the top of stop + 40,the left of stop + 24 + (the right of drect - the left of drect),the top of stop + 40 + (the bottom of drect - the top of drect))
set the visible of window "demopop.dir" = true
tell window "demopop.dir" to starttimer
tell the stage to pause
cursor 4
cursor -1
end
on openeventq
-- global eq
-- openXlib "EventQ"
-- set eq = EventQ(mNew)
end
on closeeventq
-- global eq
-- if objectP(eq) then
-- eq(mDispose)
-- closeXlib "EventQ"
-- end if
end
on startbuffering
-- global eq
-- eq(mBufferEvents)
-- repeat
--
-- Do some critical Lingo here, without interference from the user.
--
-- Have they hit the mouse button?
--
-- set mouseString = eq(mGetNextEvent, "mouseDown", 1)
--
-- mouseString will be: "mouseDown 100, 244" if left button down at
-- these coordinates
--
-- until someCondition
--
-- Stop the buffering
--
end
on flushevents
if the machinetype = 256 then
if objectp(eq) then put eq(mFlushEvents) into yikes